//
//  UIView+Extension.h
//  JiLaiBao
//
//  Created by youmy on 15/8/14.
//  Copyright (c) 2015年 youmy. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Extension)
/** x坐标 */
@property (nonatomic, assign) CGFloat x;
/** y坐标 */
@property (nonatomic, assign) CGFloat y;
/** 中心x坐标 */
@property (nonatomic, assign) CGFloat centerX;
/** 中心y坐标 */
@property (nonatomic, assign) CGFloat centerY;
/** 宽度 */
@property (nonatomic, assign) CGFloat width;
/** 高度 */
@property (nonatomic, assign) CGFloat height;
/** 大小 */
@property (nonatomic, assign) CGSize size;
/** 原点 */
@property (nonatomic, assign) CGPoint origin;

/** 绘制边框 */
- (void)drawBorder;

/** 绘制边框+颜色 */
- (void)drawBorderWithColor:(UIColor *)color;

/** 绘制边框+颜色+线条宽度 */
- (void)drawBorderWithColor:(UIColor *)color borderWidth:(CGFloat)width;

/** 绘制边框+圆弧 */
- (void)drawBorderWithCornerRadius:(CGFloat)radius;

/** 绘制边框+颜色+圆弧 */
- (void)drawBorderWithColor:(UIColor *)color radius:(CGFloat)radius;

/** 绘制边框+颜色+边框宽度+圆弧 */
- (void)drawBorderWithColor:(UIColor *)color borderWidth:(CGFloat)width radius:(CGFloat)radius;
- (void)drawCircle:(CGFloat)witdh borderColor:(UIColor *)borderColor;
- (void)drawBorder:(CGFloat)witdh borderColor:(UIColor *)borderColor;
/** 添加阴影 */
- (void)addShadow;

- (void)addBottomShadow:(UIColor *)color;

/**
 *  画线
 *
 *  @param color 线条颜色
 *  @param rect  线条frame
 */
- (void)drawLineWithColor:(UIColor *)color rect:(CGRect)rect;

- (void)addTopLine;
- (void)addTopLineWithColor:(UIColor *)color;
- (void)addTopLineWithLeft:(CGFloat)left right:(CGFloat)right;
- (void)addTopLineWithColor:(UIColor *)color left:(CGFloat)left right:(CGFloat)right;
- (void)addTopLineWithColor:(UIColor *)color width:(CGFloat)width;

- (void)addBottomLine;
- (void)addBottomLineWithColor:(UIColor *)color;
- (void)addBottomLineWithLeft:(CGFloat)left right:(CGFloat)right;
- (void)addBottomLineWithColor:(UIColor *)color left:(CGFloat)left right:(CGFloat)right;
- (void)addBottomLineWithColor:(UIColor *)color height:(CGFloat)height;

- (void)addLeftLine;
- (void)addLeftLineWithColor:(UIColor *)color;
- (void)addLeftLineOffset:(CGFloat)offset;
- (void)addLeftLineWidth:(CGFloat)width;
- (void)addLeftLineWidth:(CGFloat)width offset:(CGFloat)offset;
- (void)addLeftLineWithColor:(UIColor *)color width:(CGFloat)width;
- (void)addLeftLineWithColor:(UIColor *)color width:(CGFloat)width offset:(CGFloat)offset;

- (void)addRightLine;
- (void)addRightLineWithColor:(UIColor *)color;
- (void)addRightLineOffset:(CGFloat)offset;
- (void)addRightLineWidth:(CGFloat)width;
- (void)addRightLineWiidth:(CGFloat)width offset:(CGFloat)offset;
- (void)addRightLineWithColor:(UIColor *)color width:(CGFloat)width;
- (void)addRightLineWithColor:(UIColor *)color width:(CGFloat)width offset:(CGFloat)offset;

/** 隐藏键盘 */
- (void)hideKeyboard;

/** 获取所以变量 */
- (void)allIvar;

/** 获取所有属性 */
- (void)allProperty;

-(UIView *)getFirstResponder;

//自定义表头
+(UIView *)sectionHeader;
#pragma mark - 设置部分圆角
/**
 *  设置部分圆角(绝对布局)
 *
 *  @param corners 需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners
 *  @param radii   需要设置的圆角大小 例如 CGSizeMake(20.0f, 20.0f)
 */
- (void)addRoundedCorners:(UIRectCorner)corners
                withRadii:(CGSize)radii;
/**
 *  设置部分圆角(相对布局)
 *
 *  @param corners 需要设置为圆角的角 UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight | UIRectCornerAllCorners
 *  @param radii   需要设置的圆角大小 例如 CGSizeMake(20.0f, 20.0f)
 *  @param rect    需要设置的圆角view的rect
 */
- (void)addRoundedCorners:(UIRectCorner)corners
                withRadii:(CGSize)radii
                 viewRect:(CGRect)rect;

@end
